import http from '@/utils/http'

//  获取home 轮播图数据
export const getHomeSwiperAPI = (newvalue) => {
  return http.get('/home/banner', {
    params: {
      distributionSite: newvalue === "" ? "1" : newvalue
    }
  })
}


// 新鲜好物api
export const getNewAPI = () => {
  return http('/home/new')
}

// 人气推荐api
export const getRecommendAPI = () => {
  return http('/home/hot')
}


/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return http('/home/goods')
}


/**
 * @description: 获取面包线api
 * @param {*}
 * @return {*}
 */

export const getCategoryAPI = (id) => {
  return http('/category', {
    params: {
      id
    }
  })
}


/**
 * @description: 获取二级分类列表数据
 * @param {*} id 分类id
 * @return {*}
 */
export const getCategoryFil = (id) => {
  return http({
    url:'/category/sub/filter',
    params:{
      id
    }
  })
}
